package com.ocom.webapi.controller;

import com.ocom.common.constant.WebApiServiceUrl;
import com.ocom.common.resp.Result;
import com.ocom.common.vo.webapi.UpdateAccessVo;
import com.ocom.webapi.service.AccessService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: TODO
 * @Author: 朱晖
 * @Date: 2022/6/22
 **/

@Slf4j
@RestController
@PreAuthorize("@pms.hasRole('ROLE_WEB')" )
public class UpdateUserAccessController {

	@Autowired
	AccessService accessService;

	@PostMapping(WebApiServiceUrl.URL_UpdateUserAccess)
	public Result updateUserAccess(@RequestBody UpdateAccessVo updateAccessVo){
		return accessService.updateUserAccess(updateAccessVo);
	}


}
